#include <bits/stdc++.h>
using namespace std;

int n;
int main()
{
    cin >> n;
    int cnt = 0, x;
    for (int i = 1; i <= n; i++) {
        cin >> x;
        cnt += x & 1;
    }
    if (n - cnt >= cnt) {
        cout << cnt;
        return 0;
    }
    cout << n - cnt + (cnt * 2 - n) / 3;
    return 0;
}